package com.woniu40.petai_manager.mapper;

import com.woniu40.petai_manager.entity.Role;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import com.woniu40.petai_manager.vo.RoleVo;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
@Repository
public interface RoleMapper {
    int deleteByPrimaryKey(Integer roleId);

    int insert(RoleVo roleVo);

    Role selectByPrimaryKey(Integer roleId);
    @Select("Select * from t_role")
    List<Role> selectAll();

    List<Role> selectAll1(String roleLName);

    int updateByPrimaryKey(Role record);
    List<Role> selectAllByManager(Integer ManagerId);
    //根据管理员ID查询中间表的角色ID  两表联查
    List<Integer> selectRoleIdByManager(Integer managerId);

    RoleVo selectRoleVo(Integer roleId);

    int insertRolePermission(@Param("roleId") Integer roleId, @Param("permissionIds") List<Integer> permissionIds, @Param("date") Date date);

    int deleteRolePermission(Integer roleId);

    int updateRole(RoleVo roleVo);

    List<Role> selectByManagerId(Integer managerId);

}